package com.liu.design.behavior.observer;

/**
 * @author LIU
 * @version 1.0
 * @description: 主播实现类
 * @date 2022/12/20 10:35
 */
public class MMTiktok extends AbstractTiktok{



    void startSell(){
        System.out.println("我要开直播了");
        notifyFans("主播开播了，开始卖货");
    }

    void endSell(){
        System.out.println("货已经卖完了，记得五星好评");
        notifyFans("主播关播了");
    }


    @Override
    void addFans(AbstractFans fans) {
        this.fansList.add(fans);
    }

    @Override
    void notifyFans(String msg) {
        //通知所有的粉丝
        for (AbstractFans fans : fansList) {
            fans.acceptMsg(msg);
        }
    }
}
